package org.example.baomidou.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.baomidou.entity.Goods;
import org.example.baomidou.mapper.GoodsMapper;
import org.example.baomidou.service.GoodsService;
import org.springframework.stereotype.Service;

@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {

    //读写goods库
    @DS("goods")
    @Override
    public int saveGoods() {
        Goods goods = new Goods();
        goods.setSku("sku");
        goods.setGoodsName("goods1");
        goods.setStock(10);
        save(goods);
        return 1;
    }

}
